<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        用户名：<input type="text" v-model.trim="user.username"><br>
        密码：<input type="text" v-model.number="user.password"><br>
        性别：<input type="radio" value="male" name="gender" v-model="user.gender">男
        <input type="radio" value="female" name="gender" v-model="user.gender">女<br>
        爱好：<input type="checkbox" value="a1" v-model="user.hobby">唱歌
        <input type="checkbox" value="a2" v-model="user.hobby">跳舞
        <input type="checkbox" value="a3" v-model="user.hobby">rap<br>
        地址：<select>
            <option value="d1">四川</option>
            <option value="d2">重庆</option>
            <option value="d3">贵州</option>
        </select><br>
        介绍:<textarea cols="30" rows="10"></textarea>
        <button @click="click1">提交</button><br>
        {{user}}
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                user:{
                    hobby:[]
                }
            },
            methods: {
                click1(){
                    var data=JSON.stringify(this.user);
                    console.log(data);
                    
                }

            }
        })
    </script>
</body>

</html>